/*
 *   IRC - Internet Relay Chat, include/config.h
 *   Copyright (C) 1990 Jarkko Oikarinen
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 1, or (at your option)
 *   any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#ifndef	__config_include__
#define	__config_include__

#include "setup.h"

/*
 *
 *   NOTICE
 *
 * Under normal conditions, you should not have to edit this file.  Run
 * the Config script in the root directory instead!
 *
 */

/*
 *  Compression level.  1 is fastest and 9 is slowest.
 * Do not use a setting above 5 or the ircd will use a lot more
 * cpu.
 */
#ifdef ZIP_LINKS
#define ZIP_LEVEL 2
#endif

/*
  What network are we linked to? Define netwide policy here.
*/

#define irc_network "AstralIRC"
#define admin_chan  "#Astral"
#define random_serv "irc.astralirc.net"
#define network_www "http://www.astralirc.net"
#define network_aup "http://www.astralirc.net/aup/"
#define netwide_kline "admin@astralirc.net"


#define CLIENT_MASKING
#define MASK_ON_CONNECT
#define OPER_MASKS

/* undef this to fix *\*!*@* ban bug */
#undef ESCAPED_MATCHING

#ifdef CLIENT_MASKING
#define userspace_mask_prefix "Astral"
#endif

/*
 This will enable mode +x for users.
 Please make sure all servers connected to yours are sc3.02 or above.
 Or you will encounter some weird results - GZ
*/

#define USERSPACE_X
#define userspace_x_prefix "Astral"

/* This will be the maximum length of a quit-message */

#define QUITLEN 90

/* High Traffic Command protection code settings (-GZ)
 *
 * HTCTIME   	Minimum time between sending commands.
 * HTCTRIGGER	Triggers and sends locops when reached.
 */

#define HTCTIME 5
#define HTCTRIGGER 15

/* Oper Masks for the hide code */
#if defined(CLIENT_MASKING) && defined(OPER_MASKS)
#define locop_host      "Local.AstralIRC.Net"
#define ircop_host      "IRCop.AstralIRC.Net"
#define admin_host      "Admin.AstralIRC.Net"
#define sadmin_host     "ServOp.AstralIRC.Net"
#define sroot_host		"SRA.AstralIRC.Net"
#define netadmin_host	"NetAdmin.AstralIRC.Net"
#define netmanager_host	"NetCoder.AstralIRC.Net"
#define netfounder_host "NetFounder.AstralIRC.Net"
#endif

/* Additional flags to give FreeBSD's malloc, only play with this if you
 * know what you're doing.
 */

#define MALLOC_FLAGS_EXTRA ""

/* Many older Operating Systems are running with insecure TCP stacks.
 * This allows IP spoofing attacks, which are very difficult for
 * operators to track down and ban."
 *
 * If you have such an old OS you can enable it here but keep in mind that
 * this will be the least of your security problems.
 *
 * Enable this option for any windows version older than 2000
 */

#undef NOSPOOF


/* KLINE_ADDRESS
 *
 * This is the email address displayed to the user when they are K:lined
 * so that they can email someone in the server's administration about it.
 * It is usually set up by the Config script.
 *
 * It should be a valid email address for the users to contact.
 *
 * For our servers, note that this message is displayed when the user
 * is affected by a local K:line or k:line.  For Services-based autokills,
 * the message is set up automatically by Services to ask to email
 * <netwide email>.  It is recommended that you set this up to give a valid
 * email address for the server's admin, not <netwide email>.
 */
#ifndef KLINE_ADDRESS
#define KLINE_ADDRESS "clueless-admin@poorly.configured.server"
#endif

/*
 * SEEUSERSTATS - Sends a notice to opers set +t that the client is doing
 *               /stats, /admin or /links, #undef'ing this disables it.  -ns
 */
#define SEEUSERSTATS

/*
 * Max size arguments to stats/admin/links can be before truncation.
 * Only applies to notices sent to opers (see above).  -Ben
 */
#define USERSTATMAX	120

/*
 * NOTE: It is important to set this to the correct "domain" for your server.
 * Define this for the correct "domain" that your server is in.  This
 * is important for certain stats.  -mlv
 */
#ifndef DOMAINNAME
#define DOMAINNAME "astralirc.net"
#endif

/*
 * Define this if you wish to output a *file* to a K lined client rather
 * than the K line comment (the comment field is treated as a filename)
 */
#undef	COMMENT_IS_FILE


/* Do these work? I dunno... */

/* #undef	PCS		*//* PCS Cadmus MUNIX, use with BSD flag! */

/*
 * NOTE: On some systems, valloc() causes many problems.
 */
#undef	VALLOC			/* Define this if you have valloc(3) */

/*
 * read/write are restarted after signals defining this 1, gets
 * siginterrupt call compiled, which attempts to remove this
 * behaviour (apollo sr10.1/bsd4.3 needs this)
 */
#ifdef APOLLO
#define	RESTARTING_SYSTEMCALLS
#endif

/* #undef	DEBUGMODE	*//* define DEBUGMODE to enable debugging mode.*/
//#define DEBUGMODE

/*
 * Defining FORCE_CORE will automatically "unlimit core", forcing the
 * server to dump a core file whenever it has a fatal error.  -mlv
 * Make sure to check that your shell allows core files.
 */
#define FORCE_CORE

/*
 * Full pathnames and defaults of irc system's support files. Please note that
 * these are only the recommened names and paths. Change as needed.
 * You must define these to something, even if you don't really want them.
 */
#ifndef DPATH
#define	DPATH	"/usr/local/lib/ircd"	*//* dir where all ircd stuff is */
#endif
#ifndef SPATH
#define	SPATH	"/usr/local/bin/ircd"	*//* path to server executeable */
#endif
#define	CPATH	"ircd.conf"	/* server configuration file */
#define	MPATH	"ircd.motd"	/* server MOTD file */
#define OMPATH  "ircd.opermotd" /* server IRCop MOTD file */
#define LUPATH  "ircd.lusers"   /* server lusers file */
#define	LPATH	"debug.log"	/* Where the debug file lives, if DEBUGMODE */
#define	PPATH	"ircd.pid"	/* file for server pid */

/*
 * Define this filename to maintain a list of persons who log
 * into this server. Logging will stop when the file does not exist.
 * Logging will be disable also if you do not define this.
 * FNAME_USERLOG just logs user connections, FNAME_OPERLOG logs every
 * successful use of /oper.  These are either full paths or files within DPATH.
 */
/* Define this only if you are actually logging -Studded
#define FNAME_USERLOG "users.log"
#define FNAME_OPERLOG "opers.log"
*/

/* CHROOTDIR
 *
 * Define for value added security if you are a rooter.
 *
 * All files you access must be in the directory you define as DPATH.
 * (This may effect the PATH locations above, though you can symlink it)
 *
 * You may want to define IRC_UID and IRC_GID
 */
/* #define CHROOTDIR */

/* SHOW_INVISIBLE_LUSERS
 *
 * As defined this will show the correct invisible count for anyone who does
 * LUSERS on your server. On a large net this doesnt mean much, but on a
 * small net it might be an advantage to undefine it.
 * (This will get defined for you if you're using userload (stats w).  -mlv)
 */
#define	SHOW_INVISIBLE_LUSERS

/* NO_DEFAULT_INVISIBLE and NO_DEFAULT_HOSTHIDDEN
 *
 * When defined, your users will not automatically be attributed with user
 * mode "i" (i == invisible). Invisibility means people dont showup in
 * WHO or NAMES unless they are on the same channel as you.
 * Added the ability to hide a users hostname also as with mode z.
 * By default this mode needs to be off.
 */

#define	NO_DEFAULT_INVISIBLE

/* NO_DEFAULT_HIDE
 *
 * When defined, your users will not automatically be attributed with user
 * mode "x" (x == hidden host). Hide means people dont show their full
 * IP when somone wants to see their IP or DNS. buhbye nukes.
 */
#ifdef USERSPACE_X
#undef NO_DEFAULT_HIDE
#endif

/* If you want your server to save and restore the local/max client count */

#define SAVE_MAXCLIENT_STATS


/*  What listen() backlog value do you wish to use?  Some servers
 *  have problems with more than 5, others work fine with many, many
 *  more.
 */

#define LISTEN_SIZE 5

/* Define your maximum sendq here */

#define MAXSENDQLENGTH 3000000

/* Define the size of a bufferpool (total of ALL sendq's in use) */

#define BUFFERPOOL (9 * MAXSENDQLENGTH)

/* Define the size of your nickname history for /whowas */

#define NICKNAMEHISTORYLENGTH 500

/* OPER_* defines
 *
 * See ./docs/example.conf for examples of how to restrict access for
 * your IRC Operators
 */

/* MAXIMUM LINKS
 *
 * This define is useful for leaf nodes and gateways. It keeps you from
 * connecting to too many places. It works by keeping you from
 * connecting to more than "n" nodes which you have C:blah::blah:6667
 * lines for.
 *
 * Note that any number of nodes can still connect to you. This only
 * limits the number that you actively reach out to connect to.
 *
 * Leaf nodes are nodes which are on the edge of the tree. If you want
 * to have a backup link, then sometimes you end up connected to both
 * your primary and backup, routing traffic between them. To prevent
 * this, #define MAXIMUM_LINKS 1 and set up both primary and
 * secondary with C:blah::blah:6667 lines. THEY SHOULD NOT TRY TO
 * CONNECT TO YOU, YOU SHOULD CONNECT TO THEM.
 *
 * Gateways such as the server which connects Australia to the US can
 * do a similar thing. Put the American nodes you want to connect to
 * in with C:blah::blah:6667 lines, and the Australian nodes with
 * C:blah::blah lines. Have the Americans put you in with C:blah::blah
 * lines. Then you will only connect to one of the Americans.
 *
 * This value is only used if you don't have server classes defined, and
 * a server is in class 0 (the default class if none is set).
 *
 */
#define MAXIMUM_LINKS 1

/*
 * If your server is running as a a HUB Server then define this.
 * A HUB Server has many servers connect to it at the same as opposed
 * to a leaf which just has 1 server (typically the uplink). Define this
 * correctly for performance reasons.
 */
/* #define	HUB */

/*
 * NOTE: defining CMDLINE_CONFIG and installing ircd SUID or SGID is a MAJOR
 *       security problem - they can use the "-f" option to read any files
 *       that the 'new' access lets them. Note also that defining this is
 *       a major security hole if your ircd goes down and some other user
 *       starts up the server with a new conf file that has some extra
 *       O-lines. So don't use this unless you're debugging.
 */
#undef	CMDLINE_CONFIG /* allow conf-file to be specified on command line */

/*
 * To use m4 as a preprocessor on the ircd.conf file, define M4_PREPROC.
 * The server will then call m4 each time it reads the ircd.conf file,
 * reading m4 output as the server's ircd.conf file.
 */
#undef	M4_PREPROC

/*
 * If you wish to have the server send 'vital' messages about server
 * through syslog, define USE_SYSLOG. Only system errors and events critical
 * to the server are logged although if this is defined with FNAME_USERLOG,
 * syslog() is used instead of the above file. It is not recommended that
 * this option is used unless you tell the system administrator beforehand
 * and obtain their permission to send messages to the system log files.
 */
#undef	USE_SYSLOG

#ifdef	USE_SYSLOG
/*
 * If you use syslog above, you may want to turn some (none) of the
 * spurious log messages for KILL/SQUIT off.
 */
#undef	SYSLOG_KILL	/* log all operator kills to syslog */
#undef	SYSLOG_SQUIT	/* log all remote squits for all servers to syslog */
#undef	SYSLOG_CONNECT	/* log remote connect messages for other all servs */
#undef	SYSLOG_USERS	/* send userlog stuff to syslog */
#undef	SYSLOG_OPER	/* log all users who successfully become an Op */

/*
 * If you want to log to a different facility than DAEMON, change
 * this define.
 */
#define LOG_FACILITY LOG_DAEMON
#endif /* USE_SYSLOG */

/*
 * IDLE_FROM_MSG
 *
 * Idle-time nullified only from privmsg, if undefined idle-time
 * is nullified from everything except ping/pong.
 * Added 3.8.1992, kny@cs.hut.fi (nam)
 */
#define IDLE_FROM_MSG

/*
 * Size of the LISTEN request.  Some machines handle this large
 * without problem, but not all.  It defaults to 5, but can be
 * raised if you know your machine handles it.
 */
#ifndef LISTEN_SIZE
#define LISTEN_SIZE 5
#endif

/*
 * Max amount of internal send buffering when socket is stuck (bytes)
 */
#ifndef MAXSENDQLENGTH
#define MAXSENDQLENGTH 3000000
#endif
/*
 *  BUFFERPOOL is the maximum size of the total of all sendq's.
 *  Recommended value is 2 * MAXSENDQLENGTH, for hubs, 5 *.
 */
#ifndef BUFFERPOOL
#define	BUFFERPOOL     (9 * MAXSENDQLENGTH)
#endif

/*
 * IRC_UID
 *
 * If you start the server as root but wish to have it run as another user,
 * define IRC_UID to that UID.  This should only be defined if you are running
 * as root and even then perhaps not.
 */
/* #undef	IRC_UID */
/* #undef	IRC_GID */

/*
 * CLIENT_FLOOD
 *
 * this controls the number of bytes the server will allow a client to
 * send to the server without processing before disconnecting the client for
 * flooding it.  Values greater than 8000 make no difference to the server.
 */
#define	CLIENT_FLOOD	6000

/*
 * How many seconds in between simultaneous nick changes?
 */
#define NICK_CHANGE_DELAY	30

/*
 * How many open targets can one nick have for messaging nicks and
 * inviting them?
 */

#define MAXTARGETS		20
#define TARGET_DELAY		120

/* Define default Z:line time for SOCKS   -taz */
#define ZLINE_TIME	300

/*
 * Mandatory Section - Do Not Change
 *
 * It is VERY important that you DO NOT change any of the settings
 * in this section for a server that is or will be running on a live net.
 * If you feel the need to make a change to one of these settings
 * please write to the administrators FIRST to discuss your reasons.
 */

/* Client connection throttling
 *
 * This is based on the ircu version, modified by nikb.
 * The servers MUST use throttling. The values can
 * be changed, but shouldn't be without good reason.
 *
 * CHECK_CLONE_LIMIT is the number of clients from the
 * same IP that will be allowed. The CHECK_CLONE_LIMIT + 1'th
 * client in CHECK_CLONE_PERIOD seconds will be throttled,
 * and a temp z-line put in place for CHECK_CLONE_DELAY seconds.
 */
#define THROTTLE
#define CHECK_CLONE_LIMIT 3
#define CHECK_CLONE_PERIOD 15
#define CHECK_CLONE_DELAY 300

/*
 * Define this to prevent mixed case userids that clonebots use. However
 * this affects the servers running telclients WLD* FIN*  etc.
 */
/*
#undef	DISALLOW_MIXED_CASE
*/

/*
 * Define this if you wish to ignore the case of the first character of
 * the user id when disallowing mixed case. This allows PC users to
 * enter the more intuitive first name with the first letter capitalised
 */
#define	IGNORE_CASE_FIRST_CHAR

/* FAILOPER_WARN
 *
 * When defined, warns users on a failed oper attempt that it was/is logged
 * Only works when FNAME_OPERLOG is defined, and a logfile exists.
 * NOTE: Failed oper attempts are logged regardless.
 */
#define FAILOPER_WARN

/*
 * Define your network service names here.
 */
#define BotServ "BotServ"
#define DiceServ "DiceServ"
#define ChanServ "ChanServ"
#define MemoServ "MemoServ"
#define NickServ "NickServ"
#define OperServ "OperServ"
#define AstralServ "AstralServ"
#define WebServ  "WebServ"

/*
 * End of Mandatory section
 */

/*   STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP  */

/* You shouldn't change anything below this line, unless absolutely needed. */

/*
 * Port where ircd resides. NOTE: This *MUST* be greater than 1024 if you
 * plan to run ircd under any other uid than root.
 */
#define PORTNUM 7000 		/* 7000 default */

/*
 * Maximum number of network connections your server will allow.  This should
 * never exceed max. number of open file descrpitors and wont increase this.
 * Should remain LOW as possible. Most sites will usually have under 30 or so
 * connections. A busy hub or server may need this to be as high as 50 or 60.
 * Making it over 100 decreases any performance boost gained from it being low.
 * if you have a lot of server connections, it may be worth splitting the load
 * over 2 or more servers.
 * 1 server = 1 connection, 1 user = 1 connection.
 * This should be at *least* 3: 1 listen port, 1 dns port + 1 client
 *
 * Note: this figure will be too high for most systems. If you get an
 * fd-related error on compile, change this to 256.
 *
 * Windows users: This should be a fairly high number.  Some operations
 * will slow down because of this, but it is _required_ because of the way
 * windows NT(and possibly 95) allocate fd handles. A good number is 16384.
 */
#ifndef MAXCONNECTIONS
#define MAXCONNECTIONS	1024
#endif

/*
 * this defines the length of the nickname history.  each time a user changes
 * nickname or signs off, their old nickname is added to the top of the list.
 * The following sizes are recommended:
 * 8MB or less  core memory : 500	(at least 1/4 of max users)
 * 8MB-16MB     core memory : 500-750	(1/4 -> 1/2 of max users)
 * 16MB-32MB    core memory : 750-1000	(1/2 -> 3/4 of max users)
 * 32MB or more core memory : 1000+	(> 3/4 of max users)
 * where max users is the expected maximum number of users.
 * (100 nicks/users ~ 25k)
 * NOTE: this is directly related to the amount of memory ircd will use whilst
 *	 resident and running - it hardly ever gets swapped to disk! You can
 *	 ignore these recommendations- they only are meant to serve as a guide
 * NOTE: But the *Minimum* ammount should be 100, in order to make nick
 *       chasing possible for mode and kick.
 */
#ifndef NICKNAMEHISTORYLENGTH
#define NICKNAMEHISTORYLENGTH 2000
#endif

/*
 * Time interval to wait and if no messages have been received, then check for
 * PINGFREQUENCY and CONNECTFREQUENCY
 */
#define TIMESEC  60		/* Recommended value: 60 */

/*
 * If daemon doesn't receive anything from any of its links within
 * PINGFREQUENCY seconds, then the server will attempt to check for
 * an active link with a PING message. If no reply is received within
 * (PINGFREQUENCY * 2) seconds, then the connection will be closed.
 */
#define PINGFREQUENCY    120	/* Recommended value: 120 */

/*
 * If the connection to to uphost is down, then attempt to reconnect every
 * CONNECTFREQUENCY  seconds.
 */
#define CONNECTFREQUENCY 600	/* Recommended value: 600 */

/*
 * Often net breaks for a short time and it's useful to try to
 * establishing the same connection again faster than CONNECTFREQUENCY
 * would allow. But, to keep trying on bad connection, we require
 * that connection has been open for certain minimum time
 * (HANGONGOODLINK) and we give the net few seconds to steady
 * (HANGONRETRYDELAY). This latter has to be long enough that the
 * other end of the connection has time to notice it broke too.
 */
#define HANGONRETRYDELAY 240	/* Recommended value: 4 minutes */
#define HANGONGOODLINK 3600	/* Recommended value: 1 hour */

/*
 * Number of seconds to wait for a connect(2) call to complete.
 * NOTE: this must be at *LEAST* 10.  When a client connects, it has
 * CONNECTTIMEOUT - 10 seconds for its host to respond to an ident lookup
 * query and for a DNS answer to be retrieved.
 */
#define	CONNECTTIMEOUT	60	/* Recommended value: 60 */

/*
 * Max time from the nickname change that still causes KILL
 * automaticly to switch for the current nick of that user. (seconds)
 */
#define KILLCHASETIMELIMIT 90   /* Recommended value: 90 */

/*
 * Max number of channels a user is allowed to join.
 */
#define MAXCHANNELSPERUSER  10	/* Recommended value: 10 */

#endif /* __config_include__ */

